// JavaScript Document
function viewTopic()
{
	with (window.document.frmListTopic) {
		if (cboCategory.selectedIndex == 0) {
			window.location.href = 'index.php';
		} else {
			window.location.href = 'index.php?catId=' + cboGroup.options[cboGroup.selectedIndex].value;
		}
	}
}

function checkAddTopicForm()
{
	with (window.document.frmAddTopic) {
		/*if (cboGroup.selectedIndex == 0) {
			alert('Choose the Topic Group');
			cboGroup.focus();
			return;
		} else*/ if (isEmpty(txtMadt, 'Nhập mã đề tài')) {
			return;
		} else {
			submit();
		}
	}
}

function addTopic()
{
	window.location.href = 'index.php?view=add';
}

function modifyTopic(matg, nhomnc_id)
{
	window.location.href = 'index.php?view=modify&matg=' + matg + '&nhomnc_id=' + nhomnc_id;
}

function deleteTopic(matg, mannc)
{
	if (confirm('Xóa tác giả này?')) {
		window.location.href = 'processTopic.php?action=deleteTopic&matg=' + matg + '&mannc=' + mannc;
	}
}

function deleteImage(matg)
{
	if (confirm('Delete this image')) {
		window.location.href = 'processTopic.php?action=deleteImage&matg=' + matg;
	}
}